﻿using Common.dto;

using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.ModelBinding;
using Newtonsoft.Json;
using WebApi.service;


namespace WebApi.Controllers;


[ApiController]
[Route("/api/[controller]/[action]")]
public class ToDoTaskController:ControllerBase
{
    private readonly IToDoTaskService _toDoTaskService;

    public ToDoTaskController(IToDoTaskService toDoTaskService)
    {
        _toDoTaskService = toDoTaskService;
    }

    [HttpGet]
    public Page<ToDoTaskDto> Page([FromQuery,BindingBehavior(BindingBehavior.Optional)] BaseQuery query,[FromQuery,BindingBehavior(BindingBehavior.Optional)] ToDoTaskDto toDoTaskDto)
    {
        return _toDoTaskService.Page(query.ToPage<ToDoTaskDto>(),toDoTaskDto);
    }
}